Skip to content

Listen on port 5151 by default in the web examples - #253

Merged
jwrosewell merged 2 commits into
rcfrom
feature/port-5151
Nov 20, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
feature/port-5151

Conversation

@51DTechResponse

@51DTechResponse 51DTechResponse commented Nov 20, 2026 •

Copy link
Copy Markdown

Why

Our readmes now tell people to open the web examples on port 5151. The code didn't agree. Some examples used 5000, some 5001, one used 5100, and two just took Flask's default. This change makes every web example listen on 5151 unless you ask for something else.

What changed

Only the default port moves. Here's each example and readme:

Example or readme Old default New default
Device detection, cloud getting started (web) 5000 5151
Device detection, cloud User-Agent Client Hints (web) 5000 5151
Device detection, on-premise getting started (web) 5001 5151
Device detection, on-premise User-Agent Client Hints (web) 5001, fixed 5151, fixed
IP Intelligence, cloud getting started (web) Flask's 5000 5151
IP Intelligence, on-premise getting started (web) Flask's 5000 5151
Cloud request engine, mixed getting started (web), and its readme 5000 5151
DID creator context server, and its readme 5100 5151
pipeline/readme.md and location/readme.md flask run (5000) flask run --port 5151

The JavaScript harness for the creator context page also uses localhost:5151 now, so it matches.

What stays the same

If an example read the PORT environment variable before, it still does. Only the fallback is new. Our CI sets PORT to 8097 for cloud and 8098 for on-premise in device-detection/ci/run-integration-tests.ps1, and that keeps working as before.

We left a few ports alone because they aren't ours to pick: the mock usage server in test_usage.py (5000), the mock update server (5689), and the test servers on port 0.

One gap remains. The on-premise User-Agent Client Hints example and both IP Intelligence web examples still don't read PORT. That was true before this change too, and it's left for a separate piece of work.

No library code changed, so there's no version bump.

Tests

The first commit, a56efa4, adds the tests on their own:

  • device-detection/fiftyone_devicedetection_examples/tests/test_devicedetection_web_example_ports.py
  • ip-intelligence/fiftyone_ipintelligence_examples/tests/test_ipintelligence_web_example_ports.py
  • pipeline/fiftyone_pipeline_cloudrequestengine/examples/tests/test_cloud_mixed_web_port.py
  • pipeline/fiftyone_pipeline_did/tests/test_creator_context_port.py

They parse each example's source with ast. Nothing starts a server, and no key or data file is needed. Each one checks that the default is 5151. The device detection test also confirms that the three examples that read PORT still read it. Against rc they should fail, since the defaults there are 5000, 5001, 5100, or nothing at all. The second commit, c2eaa51, makes the change.

Runs

Two temporary branches add the workflow on top of each commit:

  • Red: commit a56efa4 plus workflow, run 44704218276
  • Green: commit c2eaa51 plus workflow, run 44704230212

The red run failed, as it should. All 10 Build and Test jobs failed, across Ubuntu and Windows on Python 3.10 to 3.14. In the Ubuntu Python 3.12 job, the one failing test is the new test_creator_context_port.py, which found 5100 where it expects 5151. Every other test in that job passed.

The green run passed, with every job succeeding.

The tests haven't been run anywhere else.

Before you upgrade

Bookmarked an example at localhost:5000, 5001, or 5100? It'll now be at localhost:5151. If you'd rather keep your old port, set PORT for the examples that read it, or run flask run --port <port>.

@jwrosewell
jwrosewell marked this pull request as ready for review November 20, 2026 11:40
@jwrosewell
jwrosewell merged commit b64b480 into rc Nov 20, 2026
4 checks passed
@jwrosewell
jwrosewell deleted the feature/port-5151 branch November 20, 2026 11:40
@jwrosewell jwrosewell mentioned this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants